/**
 * Selling Partner API for Easy Ship
 * Use the Selling Partner API for Easy Ship to build applications for sellers to manage and ship Amazon Easy Ship orders. With this API, you can get available time slots, schedule and reschedule Easy Ship orders, and print shipping labels, invoices, and warranties. To review the differences in Easy Ship operations by marketplace, refer to [Marketplace support](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support).
 *
 * The version of the OpenAPI document: 2022-03-23
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 *
 */

import { ApiClient } from '../ApiClient.js'
import { Package } from './Package.js'
import { RejectedOrder } from './RejectedOrder.js'

/**
 * The CreateScheduledPackagesResponse model module.
 * @module easyship_v2022_03_23/model/CreateScheduledPackagesResponse
 * @version 2022-03-23
 */
export class CreateScheduledPackagesResponse {
  /**
   * Constructs a new <code>CreateScheduledPackagesResponse</code>.
   * The response schema for the bulk scheduling API. It returns by the bulk scheduling API containing an array of the scheduled packtages, an optional list of orders we couldn&#39;t schedule with the reason, and a pre-signed URL for a ZIP file containing the associated shipping labels plus the documents enabled for your marketplace.
   * @alias module:easyship_v2022_03_23/model/CreateScheduledPackagesResponse
   * @class
   */
  constructor () {
  }

  /**
   * Constructs a <code>CreateScheduledPackagesResponse</code> from a plain JavaScript object, optionally creating a new instance.
   * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
   * @param {Object} data The plain JavaScript object bearing properties of interest.
   * @param {CreateScheduledPackagesResponse} obj Optional instance to populate.
   * @return {CreateScheduledPackagesResponse} The populated <code>CreateScheduledPackagesResponse</code> instance.
   */
  static constructFromObject (data, obj) {
    if (data) {
      switch (typeof data) {
        case 'string':
          obj = String(data)
          break
        case 'number':
          obj = Number(data)
          break
        case 'boolean':
          obj = Boolean(data)
          break
      }
      obj = obj || new CreateScheduledPackagesResponse()
      if (data.hasOwnProperty('scheduledPackages')) { obj.scheduledPackages = ApiClient.convertToType(data.scheduledPackages, [Package]) }
      if (data.hasOwnProperty('rejectedOrders')) { obj.rejectedOrders = ApiClient.convertToType(data.rejectedOrders, [RejectedOrder]) }
      if (data.hasOwnProperty('printableDocumentsUrl')) { obj.printableDocumentsUrl = ApiClient.convertToType(data.printableDocumentsUrl, 'String') }
    }
    return obj
  }
}

/**
 * A list of packages. Refer to the `Package` object.
 * @member {[Package]} scheduledPackages
 * @type {[Package]}
 */
CreateScheduledPackagesResponse.prototype.scheduledPackages = undefined

/**
 * A list of orders we couldn't scheduled on your behalf. Each element contains the reason and details on the error.
 * @member {[RejectedOrder]} rejectedOrders
 * @type {[RejectedOrder]}
 */
CreateScheduledPackagesResponse.prototype.rejectedOrders = undefined

/**
 * A pre-signed URL for the zip document containing the shipping labels and the documents enabled for your marketplace.
 * @member {String} printableDocumentsUrl
 * @type {String}
 */
CreateScheduledPackagesResponse.prototype.printableDocumentsUrl = undefined
